<?php

namespace App\Http\Controllers;

use EasyWeChat\Foundation\Application;

use Illuminate\Http\Request;

use App\Http\Requests;

class MaterialController extends Controller
{
    //
    public $material;
    public $broadcast;

    public function __construct(Application $app){

      $this->material = $app->material;
      $this->broadcast = $app->broadcast;

    }

    //上传图片
    public function image($imagepath){

      $image = $this->material->UpLoadImage(public_path().$imagepath);

      return $image;

    }


    //返回所有图片
    public function images(){

      $images = $this->material->lists('image');

      return $images;

    }


    //上传音频
    public function audio($audiopath){

      $audio = $this->material->UpLoadVoice(public_path().$audiopath);

      return $audio;

    }

    //获取音频列表
    public function materials(){

      return $this-material->lists('voice')；

    }

    //获取视频
    public function media($mediaId){

      return $this->material->get($mediaId);

    }


}
